""" generators should be considered every time you deal
with a function that returns a sequence or works in a loop
a common use case is to stream data buffers with generators """

def fibnonacci():
    a , b = 0, 1
    while True :
        yield b
        a , b = b, a+b

fib = fibnonacci()
print fib.next()
result = [fib.next() for i in range(5)]
print result


